package org.jeecg.modules.service.patient.impl;

import com.baomidou.dynamic.datasource.annotation.DS;
import org.jeecg.modules.bean.entity.patient.Brjbxx;
import org.jeecg.modules.service.patient.BrjbxxService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Package : com.nmyx.api.hszm.service.impl
 * @Author :
 * @Date : 2023-08-07 9:24
 * @Desc :
 */
@Service
@DS("db2")
public class BrjbxxServiceImpl implements BrjbxxService {

    @Autowired
    JdbcTemplate jdbcTemplate;

    @Override
    public List<Brjbxx> queryMzxt(String cbrh) {
        return jdbcTemplate.query(" SELECT br.cxbbm, br.CBRID, br.clxdh, mz.cmzh, mz.dgh, br.CMZBLH, br.cbrxm , br.cbrxb, br.dcsny, br.cgj, br.chy, br.cmz, br.csfzh " +
                "FROM TBBRJBXX br LEFT JOIN VTBMZGHMX2023 mz ON br.CBRID = mz.CBRID " +
                "WHERE br.cbrxm LIKE '"+ cbrh +"' OR br.csfzh like '" + cbrh+"'", new BeanPropertyRowMapper<>(Brjbxx.class));
    }
}
